<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>

<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>添加帮助</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	
	<link rel="stylesheet" type="text/css" href="css/add_goods.css">
	<script type="text/javascript">
		
		/* 校验  */
		function losefocus1(){
		
			if(document.getElementById("askId").value==""){
				document.getElementById("null_span1").innerText="问题不能为空";
			}
				
		}
	    function getfocus1(){
		
			
			document.getElementById("null_span1").innerText="";
			
				
		}	
		function losefocus2(){
		
			if(document.getElementById("answerId").value==""){
				document.getElementById("null_span2").innerText="回答不能为空";
			}
				
		}
	    function getfocus2(){
		
			
			document.getElementById("null_span2").innerText="";
			
				
		}	
		var bol=true;
		function jiaoyan_all(){
			if(document.getElementById("askId").value==""){
				bol=false;
				alert("问题不能为空");
			}else if(document.getElementById("answerId").value==""){
				bol=false;
				alert("回答不能为空");
			}
			if(bol==true){
				alert("添加成功");
			}
			return bol;
			
		}
	</script>

  </head>
  
  <body >
  	<!--总div  -->
     <div class="div_all">
     	<div class="div_2">
     		<!-- 添加div -->
     		<div class="div_add">
	     		<form action="add_help.do" method="post" enctype="multipart/form-data" onsubmit="return jiaoyan_all()">
	     		
	     			<!-- 名称 -->
	     			<div style="margin-top:30px;">问题:<input type="text" name="ask" id="askId" onblur="losefocus1()" onfocus="getfocus1()"/><br/><span class="jiaoyan" id="null_span1"></span></div>	 
	     			<div style="margin-top:30px;">回答:<textarea name="answer" rows="20" cols="20" id="answerId" onblur="losefocus2()" onfocus="getfocus2()"></textarea><br/><span class="jiaoyan" id="null_span2"></span></div>	 
	     			<input type="submit" value="添加" style="width:50px;" class="Mysubmit" onclick="success()"/>
	     		</form>
     		</div>
     	</div>
     	
     </div>
  </body>
</html>
